#include "../Basics/BasicStruct.cpp"

//给定一个二叉树，检查它是否是镜像对称的。

bool checkIsSymmetric(TreeNode* bt1,TreeNode* bt2){
    if (bt1 == NULL && bt2 == NULL) {
        return true;
    }

    if (bt1 == NULL || bt2 == NULL) {
        return false;
    }

    return bt1->data == bt2->data && checkIsSymmetric(bt1->leftChild,bt2->rightChild) && checkIsSymmetric(bt1->rightChild,bt2->leftChild);
}

bool isSymmetric(TreeNode* root){
    return checkIsSymmetric(root,root);
}

//     1            1
//   2   2        2   2
//  3 4 1 3      3 4 1 3